package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.heima.pojo.Partner;
import com.heima.pojo.dto.PartnerDto;
import com.heima.pojo.vo.PartnerVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


/**
 * @author 赵超
 */
@Mapper
public interface PartnerMapper extends BaseMapper<Partner> {

    Page<PartnerVo> page(String name);

    @Override
    int insert(Partner partner);

    @Select("select * from tb_partner where id = #{id}")
    PartnerVo getPartnerById(Integer id);

    int updatePartnerById(@Param("id") Integer id, PartnerDto partnerDto);

    @Delete("delete from tb_partner where id = #{id}")
    int deleteById(Integer id);
}
